import { h, ref, nextTick, getCurrentInstance } from "../../lib/guide-mini-vue.esm.js";

export const App = {
    name: 'App',
    setup() {
        let count = ref(1);
        const instance = getCurrentInstance();
        function onClick() {
            for (let i = 0; i < 100; i++) {
                console.log("update");
                count.value = i;
            }
            nextTick(() => {
                console.log("instance", instance);
            })
        }
        return { onClick, count }
    },
    render() {
        const button = h("button", { onClick: this.onClick }, "click me");
        const p = h("p", {}, "count " + this.count);
        return h("div", {}, [button, p])
    }
}
